package ex2_2;

import java.util.concurrent.LinkedBlockingQueue;

class OutputData extends Thread {
	LinkedBlockingQueue<String> outputData;

	public OutputData(LinkedBlockingQueue<String> data) {
		this.outputData = data;
	}

	public void run() {
		String line = null;
		while (true) {
			try {
				line = outputData.take();
				if ("END".equals(line))
					break;
//				System.out.println(line);
			} catch (InterruptedException e) {
				e.printStackTrace();
			}
		}
	}
}
